package com.itheima.jobs;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.pojo.OrderSetting;
import com.itheima.service.OrderSettingService;
import org.springframework.stereotype.Component;

import javax.sound.midi.VoiceStatus;
import java.util.List;

/**
 * @PackageName: com.itheima.jobs
 * @ClassName: ClearlmgJob
 * @Author: dongxiyaohui
 * @Date: 2019/12/13 9:43
 * @Description: //TODO
 * 定时清理预约数据
 */
@Component
public class ClearImgJobl {
   @Reference
   private OrderSettingService orderSettingService;
   public void clearImgl() throws Exception{
     List<OrderSetting> list = orderSettingService.findOrderSettingByDate();
     if(list != null && list.size()>0){
         orderSettingService.deleteOrderSettingByDate();
         System.out.println("过期的预约数据已经被清除");
     }
   }
}
